# Copyright (c) 2020 Presto Labs Pte. Ltd.
# Author: donggu

load("@nazel//:nazel_build.bzl",
     "nazel_cc_binary",
     "nazel_cc_library",
     "nazel_cc_pymodule")

package(default_visibility = ["//visibility:public"])

# ---------------------------------- basic ---------------------------------

nazel_cc_library(
    name = "fastfeed_util",
    srcs = [
        "fastfeed_util.cc",
    ],
    hdrs = [
        "fastfeed_util.h",
    ],
    deps = ["//cc/coin2"],
)

nazel_cc_binary(
    name = "fastfeed_converter",
    srcs = [
        "fastfeed_converter.cc",
    ],
    deps = [
        ":fastfeed_util",
        "//cc/coin2",
    ],
)

nazel_cc_binary(
    name = "fastfeed_universe_converter",
    srcs = [
        "fastfeed_universe_converter.cc",
    ],
    deps = [
        ":fastfeed_util",
        "//cc/coin2",
    ],
)

nazel_cc_binary(
    name = "fastfeed_replayer",
    srcs = [
        "fastfeed_replayer.cc",
    ],
    deps = [
        ":fastfeed_util",
        "//cc/coin2",
    ],
)

nazel_cc_binary(
    name = "discontinuity_checker",
    srcs = [
        "discontinuity_checker.cc",
    ],
    deps = [
        "//cc/coin2",
    ],
)

nazel_cc_binary(
    name = "plot",
    srcs = [
        "plot.cc",
    ],
    deps = [
        "//cc/coin2",
        "//cc/third_party:vitro",
    ],
)

nazel_cc_binary(
    name = "plot2",
    srcs = [
        "plot2.cc",
    ],
    deps = [
        "//cc/coin2",
        "//cc/third_party:vitro",
    ],
)

nazel_cc_binary(
    name = "interval",
    srcs = [
        "interval.cc",
    ],
    deps = [
        "//cc/coin2",
    ],
)

nazel_cc_binary(
    name = "delay_detect",
    srcs = [
        "delay_detect.cc",
        "time_window_median.h",
    ],
    deps = [
        ":fastfeed_util",
        "//cc/coin2",
        "//cc/third_party:vitro",
    ],
)

nazel_cc_binary(
    name = "ft_et_checker",
    srcs = [
        "ft_et_checker.cc",
    ],
    deps = [
        "//cc/coin2",
    ],
)

nazel_cc_binary(
    name = "trade_burst",
    srcs = [
        "trade_burst.cc",
    ],
    deps = [
        "//cc/coin2",
        "//cc/third_party:vitro",
    ],
)

nazel_cc_binary(
    name = "kline_feed_checker",
    srcs = [
        "kline_feed_checker.cc",
    ],
    deps = [
        "//cc/coin2",
    ],
)

nazel_cc_binary(
    name = "kline_csv",
    srcs = [
        "kline_csv.cc",
    ],
    deps = [
        "//cc/coin2",
    ],
)

nazel_cc_binary(
    name = "market_data_query",
    srcs = [
        "market_data_query.cc",
    ],
    deps = [
        "//cc/coin2",
    ],
)

nazel_cc_binary(
    name = "ticker_generator",
    srcs = [
        "ticker_generator.cc",
    ],
    deps = ["//cc/coin2"],
)

nazel_cc_binary(
    name = "slim_trade_generator",
    srcs = [
        "slim_trade_generator.cc",
    ],
    deps = [
        ":fastfeed_util",
        "//cc/coin2",
    ],
)

nazel_cc_binary(
    name = "index_generator",
    srcs = [
        "index_generator.cc",
    ],
    deps = [
        ":fastfeed_util",
        "//cc/coin2",
    ],
)

nazel_cc_binary(
    name = "symbol_status_checker",
    srcs = [
        "symbol_status_checker.cc",
    ],
    deps = ["//cc/coin2"],
)

nazel_cc_binary(
    name = "ticker_provider",
    srcs = [
        "ticker_provider.cc",
    ],
    deps = ["//cc/coin2"],
)

nazel_cc_pymodule(
    name = "py_market_data_client.so",
    srcs = [
        "py_market_data_client.h",
        "py_market_data_client.cc",
    ],
    deps = [
        "//cc/coin2",
    ],
)

nazel_cc_pymodule(
    name = "py_fastfeed_reader.so",
    srcs = [
        "py_fastfeed_reader.h",
        "py_fastfeed_reader.cc",
    ],
    deps = [
        "//cc/coin2",
    ],
)
